package com.hsy.linemoney.modules.common;

import android.app.Activity;
import android.os.Bundle;

import com.deparse.dpframe.ui.android.app.activity.DPBaseActivity;
import com.hsy.linemoney.common.LoadingProgressDialog;
import com.hsy.linemoney.utils.CommonUtils;

/**
 * Created by MartinKent on 2016/11/23.
 */

public class CommonBaseActivity extends DPBaseActivity {
//    @Override
//    public void startActivity(Class<?> cls, String... extras) {
//        super.startActivity(cls, extras);
//        overridePendingTransition(android.R.anim.slide_out_right,android.R.anim.slide_in_left);
//    }
//
//    @Override
//    public void startActivityForResult(Class<?> cls, int requestCode, String... data) {
//        super.startActivityForResult(cls, requestCode, data);
//        overridePendingTransition(android.R.anim.slide_out_right,android.R.anim.slide_in_left);
//    }
//
//    @Override
//    public void startActivityWithTaskCleared(Class<?> cls, String... extras) {
//        super.startActivityWithTaskCleared(cls, extras);
//        overridePendingTransition(android.R.anim.slide_out_right,android.R.anim.slide_in_left);
//    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        hideProgressDialog();
    }

    @Override
    protected void onStop() {
        super.onStop();
        hideProgressDialog();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        hideProgressDialog();
    }

    private LoadingProgressDialog loadingProgressDialog;

    protected void showProgressDialog(Activity activity) {
        hideProgressDialog();
        loadingProgressDialog = new LoadingProgressDialog(activity);
        loadingProgressDialog.show();
    }

    protected void hideProgressDialog() {
        if (null != loadingProgressDialog) {
            loadingProgressDialog.dismiss();
            loadingProgressDialog = null;
        }
    }
}
